package com.qingcloud.fexecutor.controller;

import com.github.pagehelper.PageInfo;
import com.qingcloud.fexecutor.pojo.WebProjectDTO;
import com.qingcloud.fexecutor.service.WebPubAppService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(value = "应用相关接口", tags = "应用相关接口")
@RestController
@RequestMapping("/webpro")
public class WebAppController {

    @Resource
    private WebPubAppService webPubAppService;

    @ApiOperation(value = "已发布应用列表查询", notes = "已发布应用列表查询")
    @GetMapping("/pubapp")
    public PageInfo<WebProjectDTO.PageDTO> page() {
        return webPubAppService.query();
    }

    @ApiOperation(value = "发布版本应用详情", notes = "发布版本应用详情")
    @GetMapping("/pubdetail/{appUrl}")
    public WebProjectDTO.DetailDTO pubAppDetail(@PathVariable("appUrl") String appUrl) {
        return webPubAppService.detail(appUrl);
    }

}
